Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better track the root source code #5558

Merged
merged 4 commits into from
Feb 27, 2025
Merged

better track the root source code #5558

merged 4 commits into from
Feb 27, 2025

Conversation

jessfraz
Copy link
Contributor

@nrc let me know what you think of this change, basically before we could store all the source code files for modules but getting the root was hard since we parse and read the file out of step

@jessfraz jessfraz requested a review from nrc February 27, 2025 18:28
Copy link

qa-wolf bot commented Feb 27, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Feb 27, 2025 9:52pm

Copy link
Contributor

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I feel like now that we have the source for the main module we should be able to tidy up the module infos etc. to treat the main module more like the others, but I'm not sure how to actually do that.

@@ -171,6 +185,7 @@ impl Program {
pub fn change_meta_settings(&mut self, settings: crate::MetaSettings) -> Result<Self, KclError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a weird method because it looks like it mutates the self passed in and returns a clone of itself? I'm a bit averse to cloning the program text (and the AST?) here, so could it take self by value or just mutate self rather than cloning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah okay wasnt part of this pr but i can fix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@jessfraz
Copy link
Contributor Author

I feel like now that we have the source for the main module we should be able to tidy up the module infos etc. to treat the main module more like the others, but I'm not sure how to actually do that.

I think we will always need helpers that take in raw code but like having a helper that takes a path to a dir or file and if dir ties to find a main.kcl (since we standardize assemblies on that) would be fucking nice and then i think we can do what you say.

Signed-off-by: Jess Frazelle <[email protected]>
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 87.17949% with 15 lines in your changes missing coverage. Please review.

Project coverage is 86.42%. Comparing base (850c5c6) to head (9d06654).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/wasm-lib/kcl/src/lib.rs 30.76% 9 Missing ⚠️
src/wasm-lib/kcl/src/errors.rs 66.66% 4 Missing ⚠️
src/wasm-lib/kcl/src/execution/mod.rs 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5558      +/-   ##
==========================================
- Coverage   86.43%   86.42%   -0.02%     
==========================================
  Files          97       97              
  Lines       37194    37224      +30     
==========================================
+ Hits        32150    32169      +19     
- Misses       5044     5055      +11     
Flag Coverage Δ
wasm-lib 86.42% <87.17%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jessfraz jessfraz merged commit 5ce22e2 into main Feb 27, 2025
36 of 37 checks passed
@jessfraz jessfraz deleted the program-refactor branch February 27, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants